#pragma once
#include <atlimage.h>
#include "AniObject.h"

namespace bs
{
	class AniText : public AniObject
	{
	public:
		enum DrawMode
		{
			DM_COMMON,
			DM_TRANSPARENT,
			DM_ALPHA
		};

	public:
		AniText(int _w, int _h);
		~AniText();

		virtual void Draw(HDC dc);

		void SetText(const char* text);

		void SetDrawMode(DrawMode mode) { this->dm = mode; }
		void SetAlphaValue(unsigned char alpha) { this->alphaValue = alpha; }

		// the follows should be called before the SetText()
		void SetAlign(bool left) { this->alignLeft = left; }    // if false, then will be center
		void SetBkColor(COLORREF color) { this->bkColor = color; }
		void SetLineSpace(int space) { this->lineSpace = space; }
		void SetTextColor(COLORREF color);
		void SetFontFace(const char* face);
		void SetFontSize(int size);

	private:
		DrawMode dm;
		bool alignLeft;
		COLORREF bkColor;
		unsigned char alphaValue;
		int lineSpace;

		HDC memDc;
		HBRUSH backBr;
		LOGFONT logFont;
		HFONT curFont;
		HFONT oldFont;

		CImage image;
	};

}
